{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from bokeh.plotting import figure, gridplot, show, output_notebook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## algorithm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def kmeans(points, n_clusters):\n",
    "    # sample initial centroids\n",
    "    sample = np.random.choice(len(points), n_clusters, replace=False)\n",
    "    centroid = points[sample]\n",
    "    \n",
    "    loss = [-1, -2]\n",
    "    while not np.allclose(*loss):\n",
    "        # compute distance for each pair: point/centroid\n",
    "        distance = [np.sqrt(((points - c) ** 2).sum(1)) for c in centroid]\n",
    "        # new loss\n",
    "        loss = loss[1:] + [np.sum(distance)]\n",
    "        # assign new clusters\n",
    "        cluster = np.argmin(distance, axis=0)\n",
    "        # update centroids by new cluster means\n",
    "        for i in range(n_clusters):\n",
    "            centroid[i] = np.mean(points[cluster == i], axis=0)\n",
    "        \n",
    "    return cluster"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## run"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "generate clusters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "n = 100\n",
    "A = np.random.multivariate_normal([2, 0], [[1, .1], [-4, 1]], n)\n",
    "B = np.random.multivariate_normal([-2, 0], [[1, -4], [.1, 1]], n)\n",
    "C = np.random.multivariate_normal([2, -2], [[1, 4], [-.1, 1]], n)\n",
    "D = ['red', 'green', 'blue']\n",
    "\n",
    "points = np.r_[A, B, C]\n",
    "original_color = np.repeat(D[:3], n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "detect k-means clusters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "cluster = kmeans(points, 3)\n",
    "new_color = [D[i] for i in cluster]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "plot original and new clusters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"http://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"16889866-a9f1-4cfe-af87-3320ebc9b66a\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(global) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    window._bokeh_onload_callbacks = [];\n",
       "    window._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "\n",
       "  \n",
       "  if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    window._bokeh_timeout = Date.now() + 5000;\n",
       "    window._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    if (window.Bokeh !== undefined) {\n",
       "      document.getElementById(\"16889866-a9f1-4cfe-af87-3320ebc9b66a\").textContent = \"BokehJS successfully loaded.\";\n",
       "    } else if (Date.now() < window._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function run_callbacks() {\n",
       "    window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    delete window._bokeh_onload_callbacks\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    window._bokeh_onload_callbacks.push(callback);\n",
       "    if (window._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    window._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        window._bokeh_is_loading--;\n",
       "        if (window._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };var element = document.getElementById(\"16889866-a9f1-4cfe-af87-3320ebc9b66a\");\n",
       "  if (element == null) {\n",
       "    console.log(\"Bokeh: ERROR: autoload.js configured with elementid '16889866-a9f1-4cfe-af87-3320ebc9b66a' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.4.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "      document.getElementById(\"16889866-a9f1-4cfe-af87-3320ebc9b66a\").textContent = \"BokehJS is loading...\";\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.4.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.4.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.4.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((window.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i](window.Bokeh);\n",
       "      }if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < window._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!window._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      window._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"16889866-a9f1-4cfe-af87-3320ebc9b66a\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (window._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(this));"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <div class=\"bk-plotdiv\" id=\"55465db3-f305-47b4-be29-e377c9099f5b\"></div>\n",
       "    </div>\n",
       "<script type=\"text/javascript\">\n",
       "  \n",
       "  (function(global) {\n",
       "    function now() {\n",
       "      return new Date();\n",
       "    }\n",
       "  \n",
       "    var force = false;\n",
       "  \n",
       "    if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "      window._bokeh_onload_callbacks = [];\n",
       "      window._bokeh_is_loading = undefined;\n",
       "    }\n",
       "  \n",
       "  \n",
       "    \n",
       "    if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "      window._bokeh_timeout = Date.now() + 0;\n",
       "      window._bokeh_failed_load = false;\n",
       "    }\n",
       "  \n",
       "    var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "       \"<div style='background-color: #fdd'>\\n\"+\n",
       "       \"<p>\\n\"+\n",
       "       \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "       \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "       \"</p>\\n\"+\n",
       "       \"<ul>\\n\"+\n",
       "       \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "       \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "       \"</ul>\\n\"+\n",
       "       \"<code>\\n\"+\n",
       "       \"from bokeh.resources import INLINE\\n\"+\n",
       "       \"output_notebook(resources=INLINE)\\n\"+\n",
       "       \"</code>\\n\"+\n",
       "       \"</div>\"}};\n",
       "  \n",
       "    function display_loaded() {\n",
       "      if (window.Bokeh !== undefined) {\n",
       "        document.getElementById(\"55465db3-f305-47b4-be29-e377c9099f5b\").textContent = \"BokehJS successfully loaded.\";\n",
       "      } else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(display_loaded, 100)\n",
       "      }\n",
       "    }\n",
       "  \n",
       "    function run_callbacks() {\n",
       "      window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "      delete window._bokeh_onload_callbacks\n",
       "      console.info(\"Bokeh: all callbacks have finished\");\n",
       "    }\n",
       "  \n",
       "    function load_libs(js_urls, callback) {\n",
       "      window._bokeh_onload_callbacks.push(callback);\n",
       "      if (window._bokeh_is_loading > 0) {\n",
       "        console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "        return null;\n",
       "      }\n",
       "      if (js_urls == null || js_urls.length === 0) {\n",
       "        run_callbacks();\n",
       "        return null;\n",
       "      }\n",
       "      console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "      window._bokeh_is_loading = js_urls.length;\n",
       "      for (var i = 0; i < js_urls.length; i++) {\n",
       "        var url = js_urls[i];\n",
       "        var s = document.createElement('script');\n",
       "        s.src = url;\n",
       "        s.async = false;\n",
       "        s.onreadystatechange = s.onload = function() {\n",
       "          window._bokeh_is_loading--;\n",
       "          if (window._bokeh_is_loading === 0) {\n",
       "            console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "            run_callbacks()\n",
       "          }\n",
       "        };\n",
       "        s.onerror = function() {\n",
       "          console.warn(\"failed to load library \" + url);\n",
       "        };\n",
       "        console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      }\n",
       "    };var element = document.getElementById(\"55465db3-f305-47b4-be29-e377c9099f5b\");\n",
       "    if (element == null) {\n",
       "      console.log(\"Bokeh: ERROR: autoload.js configured with elementid '55465db3-f305-47b4-be29-e377c9099f5b' but no matching script tag was found. \")\n",
       "      return false;\n",
       "    }\n",
       "  \n",
       "    var js_urls = [];\n",
       "  \n",
       "    var inline_js = [\n",
       "      function(Bokeh) {\n",
       "        (function() {\n",
       "          var fn = function() {\n",
       "            var docs_json = {\"2439f8e3-0f1f-4139-8ca1-54dbb2cb31f6\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"ccba70ca-0bd4-4881-be52-8fb3a0cf6d2f\",\"type\":\"SaveTool\"},{\"attributes\":{\"below\":[{\"id\":\"93278224-f2d9-4215-a9bc-7fdf642a0bea\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"9dc5528c-fff7-43f6-b00f-ae5e52f76f77\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"renderers\":[{\"id\":\"93278224-f2d9-4215-a9bc-7fdf642a0bea\",\"type\":\"LinearAxis\"},{\"id\":\"be869721-d724-47f6-846e-7682cb0ea4e2\",\"type\":\"Grid\"},{\"id\":\"9dc5528c-fff7-43f6-b00f-ae5e52f76f77\",\"type\":\"LinearAxis\"},{\"id\":\"e650d43f-812d-42be-9302-1c3871e0c4ed\",\"type\":\"Grid\"},{\"id\":\"569beb5d-5d9c-4696-9631-8e5b5f0f0163\",\"type\":\"BoxAnnotation\"},{\"id\":\"e7bc11de-389c-4faa-b918-23498d7e8c4f\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"fe406dcf-1019-4a01-840b-160ef52c3035\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"76a1db81-89bb-4cda-82aa-4d85e01c9bef\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"2551660f-2f35-4f7e-bcd9-ba5f4442342e\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"0b06eb57-52ce-452b-bc50-af8f1573d4b3\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"ee6377df-b396-45ec-a02e-f7e8d6b06e1c\",\"type\":\"DataRange1d\"}},\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"330891d6-418b-427d-84b5-0085a872b0eb\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fea8b879-b1fa-424e-8358-df8a8f4b85a5\",\"type\":\"ResetTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"a78c6b62-9121-406b-abdb-02eb5611fa5e\",\"type\":\"PanTool\"},{\"id\":\"89c04bba-3aa9-4b61-adec-407ec961c1aa\",\"type\":\"WheelZoomTool\"},{\"id\":\"0e808d78-5e5c-4f16-a905-8396087b224c\",\"type\":\"BoxZoomTool\"},{\"id\":\"7d1faab0-f193-415f-b7fc-f3caee901283\",\"type\":\"SaveTool\"},{\"id\":\"fea8b879-b1fa-424e-8358-df8a8f4b85a5\",\"type\":\"ResetTool\"},{\"id\":\"519f20aa-9543-4dcb-a3a5-1c50b18374c8\",\"type\":\"HelpTool\"}]},\"id\":\"c8f555ae-2fe3-4be4-8f92-123bcd352754\",\"type\":\"Toolbar\"},{\"attributes\":{\"sizing_mode\":\"scale_width\",\"toolbar_location\":\"above\",\"tools\":[{\"id\":\"a78c6b62-9121-406b-abdb-02eb5611fa5e\",\"type\":\"PanTool\"},{\"id\":\"89c04bba-3aa9-4b61-adec-407ec961c1aa\",\"type\":\"WheelZoomTool\"},{\"id\":\"0e808d78-5e5c-4f16-a905-8396087b224c\",\"type\":\"BoxZoomTool\"},{\"id\":\"7d1faab0-f193-415f-b7fc-f3caee901283\",\"type\":\"SaveTool\"},{\"id\":\"fea8b879-b1fa-424e-8358-df8a8f4b85a5\",\"type\":\"ResetTool\"},{\"id\":\"519f20aa-9543-4dcb-a3a5-1c50b18374c8\",\"type\":\"HelpTool\"},{\"id\":\"2174abff-8029-46c7-a59f-4440652117d2\",\"type\":\"PanTool\"},{\"id\":\"7f217c80-a5e7-40fc-8ca9-1022dc625b6b\",\"type\":\"WheelZoomTool\"},{\"id\":\"d17317b5-72c3-467a-90ae-5bc3c3bf8a74\",\"type\":\"BoxZoomTool\"},{\"id\":\"ccba70ca-0bd4-4881-be52-8fb3a0cf6d2f\",\"type\":\"SaveTool\"},{\"id\":\"70bac9a0-38b4-4add-a59f-8bab1303276d\",\"type\":\"ResetTool\"},{\"id\":\"9a4e71c5-48de-402b-95d4-db993a6c4759\",\"type\":\"HelpTool\"}]},\"id\":\"b16684ad-17b0-41a9-a2e8-061110b39710\",\"type\":\"ToolbarBox\"},{\"attributes\":{},\"id\":\"9a609612-db8e-4b7d-99d1-2d17f073e542\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"fill_color\",\"line_color\"],\"data\":{\"fill_color\":[\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"blue\",\"red\",\"red\",\"blue\",\"blue\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"blue\",\"red\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"red\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"red\",\"red\",\"red\",\"red\"],\"line_color\":[\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"blue\",\"red\",\"red\",\"blue\",\"blue\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"blue\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"red\",\"red\",\"blue\",\"red\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"green\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"red\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"red\",\"red\",\"green\",\"green\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"red\",\"green\",\"green\",\"red\",\"red\",\"red\",\"red\"],\"x\":{\"__ndarray__\":\"kBXniZxx+j8KtUAnT78OQOkTKuU/Mf0/wadNPwqgAkDb/kkicf4CQNYf73d7LgNAisAqIJeCAECWKJYIjmAIQNcZE1d/ggNAc/5f4tWZ+D+/ubaPtrYGQN0MoeXBPP4/GXuknSb3BkB2tfxTO3HgP/uMAXvR5BNAmtwjK1oTFUCmVk2N4VIJQKjzg5DbcRLAoFDMdysEDEAmZOzUXQETQPw7/O6kiQdASfOPr21OAkC8mZIZn2ERQDXLJI1PnPU/+bTuQex9EUDq3JOirIIAwIAbaAU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6CeECsCoKCVSxP7ePwA4q6yJTNY/ALgAW0ftqL+oMxaGf9Ptv2XdFddAhwfA+X+1txDjGcC+9/0dDs4CwBX9S0Qyr/G/ZvKT3WoN+L91Ef2QcUX5v0Awkm+cCqU/buOyBFr3AMCABE8uqeWnP0wXoqrnqwXAkKUbNgBL8r9s06lrcIYAwCJm25smsfA/Qn54Qy7NAsCI+oQ1ZIH3v7BWm94g79g//jddtk3wB8Am/VgwP7/1PzT3t6Ql1wXAkADF8gT28b9ao0uBTintvzzm8hOQ8AjANAYb/QUgBsCgqpx73Tz1v5C/WfvS8cA/7l0v+HOeE8D2juF5ieIQwK5Lyvb+IOW/uhsQPRpD8L+6EoPXclr2P7nJE3+rnQfAQ3iDVIDMEMAa67Mdne4WwPDxCxCguPm/9Ns9lhWSEMBPtwDdwscZwBQMGZb5BRDAmys4c/9PEsAq/NHB7+QBwGWgzLU0XArAa+ah8s98/L/kcp5qAWUSwHTveb/dsATA0YjxlPSOCsAsW9wSJ90JwBQWDsqrXOs/YPghhKnBt7+H3BrdMeUHwJuXYYotBhHAzrO4lYn/9b/qbF8L3iYTwEAWfEGFBcC/YDYnLw1yxr8zID1eq2IFwIagvDG3F/S/Iq9uqU9q+D94CN4K62jdvwgzqV19KxHAJiAZswWaCMALSEOyOygLwOBedoSaVLY/0LOk09ixCMDQbw1ODS0BwLLAAJDI5gPAjLhpISHXCsD+Tj8OSeYHwPidyfKCU9Q/5n6fMtbV+L+K+4uLzz4IwByL8Upl1+Q/e7h1gCXU9797rVKJZmf3v5ZK4c6ewvC/\",\"dtype\":\"float64\",\"shape\":[300]}}},\"id\":\"456669c0-411a-4a1e-b174-861fce65fbbf\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"569beb5d-5d9c-4696-9631-8e5b5f0f0163\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"d17317b5-72c3-467a-90ae-5bc3c3bf8a74\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"fill_color\",\"line_color\"],\"data\":{\"fill_color\":[\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\"],\"line_color\":[\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"red\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\"],\"x\":{\"__ndarray__\":\"kBXniZxx+j8KtUAnT78OQOkTKuU/Mf0/wadNPwqgAkDb/kkicf4CQNYf73d7LgNAisAqIJeCAECWKJYIjmAIQNcZE1d/ggNAc/5f4tWZ+D+/ubaPtrYGQN0MoeXBPP4/GXuknSb3BkB2tfxTO3HgP/uMAXvR5BNAmtwjK1oTFUCmVk2N4VIJQKjzg5DbcRLAoFDMdysEDEAmZOzUXQETQPw7/O6kiQdASfOPr21OAkC8mZIZn2ERQDXLJI1PnPU/+bTuQex9EUDq3JOirIIAwIAbaAUaoPc/OoSkv14S5T/3RgxKa3/0P3RAWU5JCO8/PJ9lYucVBkA4JGHWt0Pbv0BsMK+ih9I/18Gaa+LB+T9VnJJ29F4HQCxCmUX3iwZAH+8ALCSIFUAMRI6yPZYFQCX8uUO5bP8/lPZd1BjDCkDZBudn8pYCQBmDI7oSb/s/nI8cQESoEEDXvlRzazYDQBrIQyvF+AhAeJ4+EqRhE0B7BQTxKDj9PwoVGSZWJP0/sSdRJHfBD0BSXyJNCcISQLA+tDiWLfs/kOyGqBuX0j9UaQIngCbVPyTeGP5+ORBAvNnEanYj8L/QPOiOZmnvPwTwPKSdH/8/3q/q38Qq6j/s4SzttD0HQMDRdvMyEes/hOPs4RBdBkA+VZ8oTEgGQIRLGZ2mFdg/Yt6RGlle8z+DRvRz/gT4P36cnFY9sPA/HKQyGFF2HkB/F4akM3sVQJM9rv9eVhFAbaMkH/cTAUA8Vph3+lblv0SiVqkfges/x1fdjCieA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HTveb/dsATA0YjxlPSOCsAsW9wSJ90JwBQWDsqrXOs/YPghhKnBt7+H3BrdMeUHwJuXYYotBhHAzrO4lYn/9b/qbF8L3iYTwEAWfEGFBcC/YDYnLw1yxr8zID1eq2IFwIagvDG3F/S/Iq9uqU9q+D94CN4K62jdvwgzqV19KxHAJiAZswWaCMALSEOyOygLwOBedoSaVLY/0LOk09ixCMDQbw1ODS0BwLLAAJDI5gPAjLhpISHXCsD+Tj8OSeYHwPidyfKCU9Q/5n6fMtbV+L+K+4uLzz4IwByL8Upl1+Q/e7h1gCXU9797rVKJZmf3v5ZK4c6ewvC/\",\"dtype\":\"float64\",\"shape\":[300]}}},\"id\":\"523ef26f-cfbf-4e40-94dc-62121397eac2\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"7d1faab0-f193-415f-b7fc-f3caee901283\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"27dfae49-7b51-4ab5-a085-b7a98bbc74bb\",\"type\":\"Circle\"},{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"70bac9a0-38b4-4add-a59f-8bab1303276d\",\"type\":\"ResetTool\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"519f20aa-9543-4dcb-a3a5-1c50b18374c8\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"2174abff-8029-46c7-a59f-4440652117d2\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9a609612-db8e-4b7d-99d1-2d17f073e542\",\"type\":\"BasicTicker\"}},\"id\":\"38565145-7cd1-447c-b676-b8ff1bd4f642\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"0b06eb57-52ce-452b-bc50-af8f1573d4b3\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"17b2bc25-3396-4d25-a68f-fafcbab9c4fa\",\"type\":\"DataRange1d\"},{\"attributes\":{\"children\":[{\"id\":\"d117bdbe-259f-4677-b8f3-2eadd0326aca\",\"type\":\"Row\"},{\"id\":\"a18c3616-0a31-44f5-a93f-e561f906a7dc\",\"type\":\"Row\"}]},\"id\":\"66a00e12-d541-46c8-b1c8-1dbf92bb11fb\",\"type\":\"Column\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"569beb5d-5d9c-4696-9631-8e5b5f0f0163\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"plot\":null,\"text\":\"k-means clusters\"},\"id\":\"fe406dcf-1019-4a01-840b-160ef52c3035\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"76a1db81-89bb-4cda-82aa-4d85e01c9bef\",\"type\":\"ToolEvents\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2174abff-8029-46c7-a59f-4440652117d2\",\"type\":\"PanTool\"},{\"id\":\"7f217c80-a5e7-40fc-8ca9-1022dc625b6b\",\"type\":\"WheelZoomTool\"},{\"id\":\"d17317b5-72c3-467a-90ae-5bc3c3bf8a74\",\"type\":\"BoxZoomTool\"},{\"id\":\"ccba70ca-0bd4-4881-be52-8fb3a0cf6d2f\",\"type\":\"SaveTool\"},{\"id\":\"70bac9a0-38b4-4add-a59f-8bab1303276d\",\"type\":\"ResetTool\"},{\"id\":\"9a4e71c5-48de-402b-95d4-db993a6c4759\",\"type\":\"HelpTool\"}]},\"id\":\"2551660f-2f35-4f7e-bcd9-ba5f4442342e\",\"type\":\"Toolbar\"},{\"attributes\":{\"formatter\":{\"id\":\"914a8e40-1414-4112-8ad6-d017a373e066\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e2df7c12-e710-4516-88a3-994ac9b8be35\",\"type\":\"BasicTicker\"}},\"id\":\"93278224-f2d9-4215-a9bc-7fdf642a0bea\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"ee6377df-b396-45ec-a02e-f7e8d6b06e1c\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"e2df7c12-e710-4516-88a3-994ac9b8be35\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e2df7c12-e710-4516-88a3-994ac9b8be35\",\"type\":\"BasicTicker\"}},\"id\":\"be869721-d724-47f6-846e-7682cb0ea4e2\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"7e2b1455-86a2-4c53-b053-e524ba55fc75\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"30af939c-eda5-42d0-9cfa-0a210aca86d2\",\"type\":\"BasicTicker\"}},\"id\":\"9dc5528c-fff7-43f6-b00f-ae5e52f76f77\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"30af939c-eda5-42d0-9cfa-0a210aca86d2\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"30af939c-eda5-42d0-9cfa-0a210aca86d2\",\"type\":\"BasicTicker\"}},\"id\":\"e650d43f-812d-42be-9302-1c3871e0c4ed\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"field\":\"fill_color\"},\"line_color\":{\"field\":\"line_color\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"367f2763-04a6-4a52-9790-e21c12c2cc86\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"456669c0-411a-4a1e-b174-861fce65fbbf\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"367f2763-04a6-4a52-9790-e21c12c2cc86\",\"type\":\"Circle\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"27dfae49-7b51-4ab5-a085-b7a98bbc74bb\",\"type\":\"Circle\"},\"selection_glyph\":null},\"id\":\"e7bc11de-389c-4faa-b918-23498d7e8c4f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"7f217c80-a5e7-40fc-8ca9-1022dc625b6b\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"9a4e71c5-48de-402b-95d4-db993a6c4759\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"7e2b1455-86a2-4c53-b053-e524ba55fc75\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"914a8e40-1414-4112-8ad6-d017a373e066\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"children\":[{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"d117bdbe-259f-4677-b8f3-2eadd0326aca\",\"type\":\"Row\"},{\"attributes\":{\"children\":[{\"id\":\"ad4db974-a026-40b9-be54-d7fd45d85706\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"a18c3616-0a31-44f5-a93f-e561f906a7dc\",\"type\":\"Row\"},{\"attributes\":{\"children\":[{\"id\":\"b16684ad-17b0-41a9-a2e8-061110b39710\",\"type\":\"ToolbarBox\"},{\"id\":\"66a00e12-d541-46c8-b1c8-1dbf92bb11fb\",\"type\":\"Column\"}]},\"id\":\"0c338e9c-3480-42d3-9b30-f5e4111b1693\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"7c280b6d-3215-417c-8583-b2c752735847\",\"type\":\"BasicTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"b9e99eca-749c-4aba-8f4e-9ae804f9f723\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7c280b6d-3215-417c-8583-b2c752735847\",\"type\":\"BasicTicker\"}},\"id\":\"1ff0f0f4-6440-41dd-97e5-dc41985a5f9b\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"330891d6-418b-427d-84b5-0085a872b0eb\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"9a609612-db8e-4b7d-99d1-2d17f073e542\",\"type\":\"BasicTicker\"}},\"id\":\"e25bbe85-ae80-4d5e-b8fa-f9ed9ed8225f\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"b4b7f6ac-7e01-428e-84d8-5e63f6d7c1ab\",\"type\":\"ToolEvents\"},{\"attributes\":{\"below\":[{\"id\":\"e25bbe85-ae80-4d5e-b8fa-f9ed9ed8225f\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"5750e9c3-2adf-429b-8714-e4d64431ee36\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"renderers\":[{\"id\":\"e25bbe85-ae80-4d5e-b8fa-f9ed9ed8225f\",\"type\":\"LinearAxis\"},{\"id\":\"38565145-7cd1-447c-b676-b8ff1bd4f642\",\"type\":\"Grid\"},{\"id\":\"5750e9c3-2adf-429b-8714-e4d64431ee36\",\"type\":\"LinearAxis\"},{\"id\":\"1ff0f0f4-6440-41dd-97e5-dc41985a5f9b\",\"type\":\"Grid\"},{\"id\":\"b9e99eca-749c-4aba-8f4e-9ae804f9f723\",\"type\":\"BoxAnnotation\"},{\"id\":\"fb2007a4-5b5b-4fe1-aad0-9a45e2e91be8\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"4860518e-029a-42de-834c-787e0228e662\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"b4b7f6ac-7e01-428e-84d8-5e63f6d7c1ab\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"c8f555ae-2fe3-4be4-8f92-123bcd352754\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"fb976ed2-7d7f-4cdd-badd-d3b1546a1bfc\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"17b2bc25-3396-4d25-a68f-fafcbab9c4fa\",\"type\":\"DataRange1d\"}},\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"89c04bba-3aa9-4b61-adec-407ec961c1aa\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"a78c6b62-9121-406b-abdb-02eb5611fa5e\",\"type\":\"PanTool\"},{\"attributes\":{\"fill_color\":{\"field\":\"fill_color\"},\"line_color\":{\"field\":\"line_color\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"42763d17-bb51-4791-bd1d-ebefe31a3033\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"b9e99eca-749c-4aba-8f4e-9ae804f9f723\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"0e808d78-5e5c-4f16-a905-8396087b224c\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"40b07b7d-810e-4b40-bbda-ca0b22fa8335\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"40b07b7d-810e-4b40-bbda-ca0b22fa8335\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"62e2bb29-f830-40ae-9f45-c696aabffa08\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7c280b6d-3215-417c-8583-b2c752735847\",\"type\":\"BasicTicker\"}},\"id\":\"5750e9c3-2adf-429b-8714-e4d64431ee36\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":null,\"text\":\"original clusters\"},\"id\":\"4860518e-029a-42de-834c-787e0228e662\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"fb976ed2-7d7f-4cdd-badd-d3b1546a1bfc\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7a949057-af1a-43c4-a2d3-774cf1381861\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"523ef26f-cfbf-4e40-94dc-62121397eac2\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"42763d17-bb51-4791-bd1d-ebefe31a3033\",\"type\":\"Circle\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"7a949057-af1a-43c4-a2d3-774cf1381861\",\"type\":\"Circle\"},\"selection_glyph\":null},\"id\":\"fb2007a4-5b5b-4fe1-aad0-9a45e2e91be8\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"0c338e9c-3480-42d3-9b30-f5e4111b1693\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.4\"}};\n",
       "            var render_items = [{\"docid\":\"2439f8e3-0f1f-4139-8ca1-54dbb2cb31f6\",\"elementid\":\"55465db3-f305-47b4-be29-e377c9099f5b\",\"modelid\":\"0c338e9c-3480-42d3-9b30-f5e4111b1693\"}];\n",
       "            \n",
       "            Bokeh.embed.embed_items(docs_json, render_items);\n",
       "          };\n",
       "          if (document.readyState != \"loading\") fn();\n",
       "          else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "        })();\n",
       "      },\n",
       "      function(Bokeh) {\n",
       "      }\n",
       "    ];\n",
       "  \n",
       "    function run_inline_js() {\n",
       "      \n",
       "      if ((window.Bokeh !== undefined) || (force === true)) {\n",
       "        for (var i = 0; i < inline_js.length; i++) {\n",
       "          inline_js[i](window.Bokeh);\n",
       "        }if (force === true) {\n",
       "          display_loaded();\n",
       "        }} else if (Date.now() < window._bokeh_timeout) {\n",
       "        setTimeout(run_inline_js, 100);\n",
       "      } else if (!window._bokeh_failed_load) {\n",
       "        console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "        window._bokeh_failed_load = true;\n",
       "      } else if (force !== true) {\n",
       "        var cell = $(document.getElementById(\"55465db3-f305-47b4-be29-e377c9099f5b\")).parents('.cell').data().cell;\n",
       "        cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "      }\n",
       "  \n",
       "    }\n",
       "  \n",
       "    if (window._bokeh_is_loading === 0) {\n",
       "      console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "      run_inline_js();\n",
       "    } else {\n",
       "      load_libs(js_urls, function() {\n",
       "        console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "        run_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }(this));\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output_notebook()\n",
    "\n",
    "plot1 = figure(title='original clusters', plot_height=300)\n",
    "plot1.scatter(x=points[:, 0], y=points[:, 1], color=original_color)\n",
    "\n",
    "plot2 = figure(title='k-means clusters', plot_height=300)\n",
    "plot2.scatter(x=points[:, 0], y=points[:, 1], color=new_color)\n",
    "\n",
    "show(gridplot([[plot1], [plot2]]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
